package com.dsh.expressSetting.service.impl;

import com.dsh.expressSetting.dao.ExpressSettingDao;
import com.dsh.expressSetting.entity.ExpressSetting;
import com.dsh.expressSetting.entity.RuleVo;
import com.dsh.expressSetting.service.ExpressSettingService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 快递设置(ExpressSetting)表服务实现类
 *
 * @author makejava
 * @since 2022-05-12 15:13:52
 */
@Service("expressSettingService")
public class ExpressSettingServiceImpl implements ExpressSettingService {
    @Resource
    private ExpressSettingDao expressSettingDao;

    @Override
    public ExpressSetting selectOne() {
        ExpressSetting expressSetting = expressSettingDao.selectOne();
        return expressSetting;
    }

    @Override
    public PageInfo<RuleVo> selectRule(int page,int limit) {
        PageHelper.startPage(page,limit);
        List<RuleVo> ruleVos = expressSettingDao.selectRule();
        return new PageInfo<>(ruleVos);
    }
}